package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.mapper.ProductUnitMapper;
import com.zhentao.model.entity.base.ProductUnit;
import com.zhentao.model.vo.common.Result;
import com.zhentao.model.vo.common.ResultCodeEnum;
import com.zhentao.service.ProductUnitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 小明
* @description 针对表【product_unit(商品单位)】的数据库操作Service实现
* @createDate 2024-08-19 20:56:21
*/
@Service
public class ProductUnitServiceImpl extends ServiceImpl<ProductUnitMapper, ProductUnit>
    implements ProductUnitService{

    @Autowired
    private ProductUnitMapper productUnitMapper;
    @Override
    public Result productUnit() {

        LambdaQueryWrapper<ProductUnit> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(ProductUnit::getIsDeleted, 1);
        List<ProductUnit> productUnits = productUnitMapper.selectList(wrapper);
        return Result.build(productUnits, ResultCodeEnum.SUCCESS);
    }
}




